﻿using System.Data;

using DAL;
using Model;

namespace BLL
{
    public class DimensionBLL
    {
        public DataSet GetDimensionAll()
        {
            return DimensionDAL.GetList("");
        }

        public DataSet GetDimensionAllReport()
        {
            return DimensionDAL.GetListForReport("");
        }

        public DataSet GetDimensionClass()
        {
            return DimensionDAL.GetDimensionClass();
        }

        public Dimension GetDimension(string dimensionid)
        {
            return DimensionDAL.GetModel(int.Parse(dimensionid));
        }

        public DataSet GetDefaultDimensionByPosID(string posID)
        {
            return DimensionDAL.GetDefaultListByPosID(posID);
        }

        public DataSet GetDimensionSetByActID(string actID)
        {
            return DimensionDAL.GetDimensionSetByActID(actID);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Dimension model)
        {
            //TODO: ADD  return EnterpriseUserDAL.Add(model);
            return DimensionDAL.Add(model);
        }

        public void Delete(int dimensionid)
        {
            DimensionDAL.Delete(dimensionid);
        }

        public void Delete(Dimension dimension)
        {

        }

        /// <summary>
        /// 设置岗位默认维度
        /// </summary>
        /// <param name="positionID">岗位ID</param>
        /// <param name="dimID">维度ID</param>
        /// <param name="weight">维度权重</param>
        /// <returns>成功:大于0</returns>
        public int SetPositionDimension(int positionID, int dimID, float weight)
        {
            return DimensionDAL.SetPositionDimension(positionID, dimID, weight);
        }

        public int GetDimensionTime(int dimID)
        {
            return DimensionDAL.GetDimensionTime(dimID);
        }

        public int GetDimensionQuestionNm(int dimID)
        {
            return DimensionDAL.GetDimensionQuestionNm(dimID);
        }
        /// <summary>
        /// 设置活动的自定义维度
        /// </summary>
        /// <param name="activityID">活动ID</param>
        /// <param name="dimID">维度ID</param>
        /// <param name="weight">维度权重</param>
        /// <returns>成功:大于0</returns>
        public int SetActivityDimension(int activityID, int dimID, float weight)
        {
            return DimensionDAL.SetActivityDimension(activityID, dimID, weight);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public bool Exists(int ID)
        {
            return DimensionDAL.Exists(ID);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public int Update(Dimension model)
        {
            return DimensionDAL.Update(model);
        }
    }
}
